home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
pdflib
/
bindings
/
tcl
/
hello.tcl
next >
Wrap
Text File
|
1999-09-16
|
677b
|
33 lines
#!/usr/local/bin/tclsh
# simple loading the shared-library:
load ./pdflib.so
# using pdflib as package:
# lappend is unnecessary if installed at some right place
lappend auto_path .
package require pdflib
# doesn't yet work
#namespace import pdflib::*
set fp [fopen hello_tcl.pdf w]
set ip [PDF_get_info]
PDF_info_Creator_set $ip "hello.tcl"
PDF_info_Author_set $ip "RJS"
PDF_info_Title_set $ip "Hello world (Tcl)"
PDF_info_fontpath_set $ip "../../fonts"
set p [PDF_open $fp $ip]
PDF_begin_page $p 595 842
PDF_set_font $p Helvetica-Bold 18.0 $winansi
PDF_set_text_pos $p 50 700
PDF_show $p "Hello world!"
PDF_continue_text $p "(says Tcl)"
PDF_end_page $p
PDF_close $p